<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div></div>
    <button>后退</button>
    <script>
        var div = document.querySelector('div')
        console.log(location.search);
        // 1.利用substr('起始位置','截取几个字符')         截取下标7后的数据
        var params = location.search.substr(7)
        div.innerHTML = params + '欢迎';

        console.log(params);

        var btn = document.querySelector('button')
        btn.addEventListener('click', function () {
            history.go(-1)
        })
        // console.log(params);
    </script>
</body>

</html>